//
//  StatusPictureCell.m
//  OC-LBWeibo
//
//  Created by 李博 on 15/7/15.
//  Copyright © 2015年 libo. All rights reserved.
//

#import "StatusPictureCell.h"
#import "UIImageView+WebCache.h"

@interface StatusPictureCell()

@property(nonatomic,weak)UIImageView *iconView;

@end

@implementation StatusPictureCell

- (void)setImageURL:(NSURL *)imageURL
{
    _imageURL = imageURL;
    
    //如果本地有缓存，直接加载本地缓存，如果没有，直接下载
    [self.iconView sd_setImageWithURL:imageURL];
}

- (nonnull instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        UIImageView *iconView = [[UIImageView alloc]init];
        iconView.frame = self.bounds;
        //设置图片填充模式----等比例填充，需要裁切
        iconView.contentMode = UIViewContentModeScaleAspectFill;
        //两句配合使用
        iconView.clipsToBounds = YES;
        [self addSubview:iconView];
        self.iconView = iconView;
    }
    return self;
}


@end
